package cn.samler.account_manager.mapper;

import cn.samler.account_manager.entity.Account;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AccountMapper {
    int insert(Account account);

    int update(Account account);

    int delete(Account account);

    Account findById(int id);

    Account findByUsername(String username);

    List<Account> listByPage(@Param("start") int start, @Param("offset") int offset);

    List<Account> searchByPage(@Param("failed") String failed, @Param("val") Object val, @Param("fuzzyQuery") boolean fuzzyQuery,
                               @Param("start") int start, @Param("offset") int offset);

    List<Account> listAll();

    int countAll();

    int countBy(@Param("failed") String failed, @Param("val") Object val, @Param("fuzzyQuery") boolean fuzzyQuery);
}
